cmake_minimum_required(VERSION 3.25)
project(WebServer)

set(CMAKE_CXX_STANDARD 14)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")

# 包含 在构建(build)中添加包含目录
include_directories(logd)
include_directories(utils)
include_directories(pools)
include_directories(http)
include_directories(server)
include_directories(timer)
include_directories(/usr/include/mysql)

# 添加目录下的所有cpp文件
aux_source_directory(logd SRC_LOGD)
aux_source_directory(utils SRC_BUFFER)
aux_source_directory(pools SRC_POOLS)
aux_source_directory(timer SRC_TIMER)
aux_source_directory(server SRC_SERVER)
aux_source_directory(http SRC_HTTP)

add_executable(WebServer
        main.cpp
        ${SRC_LOGD}
        ${SRC_BUFFER}
        ${SRC_POOLS}
        ${SRC_TIMER}
        ${SRC_SERVER}
        ${SRC_HTTP})

target_link_libraries(WebServer PUBLIC pthread)
target_link_libraries(WebServer PUBLIC mysqlclient)
